package ch.sv7.tool.dbmanager.db.utils;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;
import ch.sv7.tool.dbmanager.db.Identifiable;
import ch.sv7.tool.dbmanager.db.difference.SchemaDifferences;

/**
 * TODO: Document me!
 *
 * @author svt
 *
 */
public class CompareToolsTestCase extends TestCase{
	
	public void testCompare1() {
		CompareTool tool = new CompareTool();
		SchemaDifferences diffs = new SchemaDifferences();
		try {
		CompareTool.compareList(diffs, null, null, null, null, null, null);
		fail("Should raise exception");
		} catch (Exception e){
			assertTrue(e instanceof IllegalArgumentException);
		}
	}
	
	public void testBadDiffClasses() {
		SchemaDifferences diffs = new SchemaDifferences();
		List list1 = new ArrayList();
		List list2 = new ArrayList();
		list2.add(new Identifiable() {

			public String getEntityType() {
				// TODO Auto-generated method stub
				return "Test";
			}

			public String getIdentity() {
				// TODO Auto-generated method stub
				return "Test";
			}

			public void computeDifferencesFromActual(SchemaDifferences diffs, Object object) {
			}
			
		});
		CompareTool.compareList(diffs, null, null, list1, list2, String.class, String.class);

	}

}
